package til.easy.escapeFromTihar;

public class UserMainCode
{
	//Assume following return types while writing the code for this question. 
   	public static int output1;

	public static void GetJumpCount(int climbUp, int climbDown, int noOfWalls, int[] wallHeights)
    {
		for(int i = 0; i < noOfWalls; i++) {
			if(wallHeights[i] <= climbUp)
				output1++;
			else
				output1 += Math.ceil((wallHeights[i] - climbUp) * 1.0 / (climbUp - climbDown)) + 1;
		}
    }
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		String[] inputs = {"10:1:1:{10}", "5:1:2:{9,10}"};
		for(int i = 0; i < inputs.length; i++) {
			output1 = 0;
			String[] toks = inputs[i].split(":");
			int climbUp = Integer.parseInt(toks[0]);
			int climbDown = Integer.parseInt(toks[1]);
			int noOfWalls = Integer.parseInt(toks[2]);
			String[] sWallHeights = toks[3].substring(1, toks[3].length() - 1).split(",");
			int[] wallHeights = new int[noOfWalls];
			for(int r = 0; r < sWallHeights.length; r++)
				wallHeights[r] = Integer.parseInt(sWallHeights[r]);
			GetJumpCount(climbUp, climbDown, noOfWalls, wallHeights);
			System.out.println(output1);
		}
	}
}
